package com.yunzheng.studyLeaveSystem.modules.enrollAndLogin.login.service;

import com.yunzheng.studyLeaveSystem.modules.enrollAndLogin.login.dao.UserDao;
import com.yunzheng.studyLeaveSystem.modules.enrollAndLogin.login.dao.UserDaoImpl;
import com.yunzheng.studyLeaveSystem.modules.enrollAndLogin.login.entity.Admin;

import java.sql.SQLException;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: YunZheng
 * @Date: 2023/01/30/10:53
 * @Description:UserService的实现类
 */
public class UserServiceImpl implements UserService{
    UserDao userDao = new UserDaoImpl();
    @Override
    public boolean isLogin(String phone_num, String password) throws Exception {
        String pwd = userDao.queryPwd(phone_num);
        if (password.equals(pwd)){
            return true;
        }
        return false;
    }

    @Override
    public boolean isExist(String phone_num) throws Exception {
        Integer id = userDao.queryId(phone_num);
        if (id!=0){
            return true;
        }
        return false;
    }

   
}